

#include  "board.h"
#include  "TypeDef.h"
#include  "hal_avr.h"
#include  "hal_int.h"


//----------------------------------------------------------------------------------
//  void halIntOn(void)
//
//  DESCRIPTION:
//    Enable global interrupts.
//
//  ARGUMENTS:
//    None
//
//  RETURNS:
//    None
//----------------------------------------------------------------------------------
void halIntOn(void)
{
    HAL_INT_ON();
}

//----------------------------------------------------------------------------------
//  void halIntOff(void)
//
//  DESCRIPTION:
//    Turns global interrupts off.
//
//  ARGUMENTS:
//    None
//
//  RETURNS:
//    None
//----------------------------------------------------------------------------------
void halIntOff(void)
{
    HAL_INT_OFF();
}

//----------------------------------------------------------------------------------
//  INT8U halIntLock(void)
//
//  DESCRIPTION:
//    Turns global interrupts off and returns current interrupt state.
//    Should always be used together with halIntUnlock().
//
//  ARGUMENTS:
//    None
//
//  RETURNS:
//    None
//----------------------------------------------------------------------------------
INT8U halIntLock(void)
{
    istate_t key;
    HAL_INT_LOCK(key);
    return(key);
}

//----------------------------------------------------------------------------------
//  void halIntUnlock(INT8U key)
//
//  DESCRIPTION:
//    Set interrupt state back to the state it had before calling halIntLock().
//    Should always be used together with halIntLock().
//
//  ARGUMENTS:
//    None
//
//  RETURNS:
//    None
//----------------------------------------------------------------------------------
void halIntUnlock(INT8U key)
{
    HAL_INT_UNLOCK(key);
}